<?

$check_me_authed = "NO_OK";

if(($jid = $_POST["radioview"]) || ($jid = $_POST["job_id_posted"]) ){

	$Db = new oracleDb;
  $Db->init($_SESSION["ORCL"],
             $_SESSION["OPASS"],
             $_SESSION["SID"],
             _NO_COMMENT);

	if ($Db->connect()) {

  	$srcDbHdr = "MST_CASH_BANK";
    $srcDbDtl = "MST_CASH_BANK_USR";

		$_SESSION["jid"]  = $_POST["radioview"];
		$jobId            = &$_SESSION["jid"];

		/**
		* Fetch global header
		* And check the status if it is valid
		* where STATUS = _NOT_ACTIVE
		*
		*/
		$CLFetchers->fetchLstDataHeader($Db,
                                    $jobId,
                                    $SourceDb->fetchValue("srcDbHdr"),
                                    $nHeader,
                                    $lstHeader);

    $_POST["codeEnt"]     = $lstHeader["C_B_CODE"][0];
    $_POST["nameEnt"]     = $lstHeader["C_B_NAME"][0];
    $_POST["accNoEnt"]    = $lstHeader["ACC_NO"][0];
    $_POST["typeEnt"]     = $lstHeader["TYPE"][0];
    $_POST["currencyEnt"] = $lstHeader["CURRENCY"][0];
    $_POST["glAccEnt"]    = $lstHeader["GL_ACC"][0];
    $_POST["glSubAccEnt"] = $lstHeader["GL_SUB_ACC"][0];

		/**
		* Init the detail
		*
		*/
		$CLFetchers->fetchLstDataDetail($Db,
                                    $jobId,
                                    $SourceDb->fetchValue("srcDbDtl"),
                                    $nDetail,
                                    $lstDetail);

		for($iRow = 0; $iRow < $nDetail; $iRow++){

      $_POST["userEnt"][$iRow] = $lstDetail["USERID"][$iRow];
		}

	  $_SESSION["modify_mode"]= "Y";

		/**
		* This is only to by pass
		* the entry_detail precheck
		*
		*/
		//$_POST["entry"]         = "byPass";
		$_SESSION["init_num"]   = $nDetail;

		$Db->dc();

		require("entry_restore_me.php");
	}else{

	  $Misc->usrDieJs(_DB_CONN_ERROR);
	}
}else{

	$Misc->usrDieJs("Error:Cant retrieved job_id");
}

?>